<template>
    <el-dialog
        :title="titleInfo"
        :visible.sync="dialogVisible"
        width="30%"
        :before-close="handleClose"
    >
        <el-form
            :model="searchParams"
            size="small"
            label-width="80px"
        >
            <el-row>
                <el-col :span="24">
                    <el-form-item label="发票类型：">
                        <el-input
                            v-model="searchParams.lzfphm"
                            placeholder="请输入"
                        ></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="24">
                    <el-form-item label="发票代码：">
                        <el-input
                            v-model="searchParams.lzfphm"
                            placeholder="请输入"
                        ></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="24">
                    <el-form-item label="发票号码：">
                        <el-input
                            v-model="searchParams.lzfphm"
                            placeholder="请输入"
                        ></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="24">
                    <el-form-item label="校验码：">
                        <el-input
                            v-model="searchParams.lzfphm"
                            placeholder="请输入"
                        ></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="24">
                    <el-form-item label="开票日期：">
                        <el-date-picker
                            v-model="selectDate2"
                            type="daterange"
                            align="right"
                            format="yyyy-MM-dd"
                            value-format="yyyy-MM-dd"
                            start-placeholder="开始日期"
                            end-placeholder="结束日期"
                        ></el-date-picker>
                    </el-form-item>
                </el-col>
                <el-col :span="24">
                    <el-form-item label="开票金额：">
                        <el-input
                        @input=" searchParams.lzfphm.replace(/[^0-9.]/g, '');"
                            v-model="searchParams.lzfphm"
                            placeholder="请输入"
                        ></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="24">
                    <div style="float: right;">
                        <el-button
                            type="primary"
                            size="small"
                            @click="revokeRedInvoice"
                        >
                            归集
                        </el-button>
                        <el-button  size="small" @click="handleClose">
                            重置
                        </el-button>
   
                    </div>
                </el-col>
            </el-row>
        </el-form>
    </el-dialog>
</template>
  
  <script>
import { checkInfoAndRisk, revokeConfirm } from '@/api/vmsHzqrdConfirm.js'

export default {
    name: 'invoiceCollection',

    data() {
        return {
            titleInfo: '发票查验',
            selectDate2: ['', ''],
            searchParams: {
                chyydm: '',
                creatBy: '',
                hzfpxxqrdbh: '',
                hzqrdsqrqq: '',
                hzqrdsqrqz: '',
                hzqrxxztdm: '',
                lrrqq: '',
                lrrqz: '',
                lzfphm: '',
                lzfpkprqq: '',
                lzfpkprqz: '',
            },
            dialogVisible: false,
        }
    },
    created() {
        // this.getList()
    },
    methods: {
        revokeRedInvoice() {
            console.log(this.selectRow)
            if (this.selectRow === null) {
                this.$message.warning('请先勾选一条数据！')
            } else {
                this.$confirm(`您确定要撤回所选择的数据吗？`, '撤销确认').then(
                    (data) => {
                        revokeConfirm(this.selectRow.id).then(
                            ({ data, code, message }) => {
                                if (code == 200) {
                                    this.$message.success(message)
                                    this.getList()
                                }
                            }
                        )
                    },
                    (err) => {}
                )
            }
        },
        show() {
            this.dialogVisible = true
        },
        handleClose() {
            this.dialogVisible = false
        },
    },
}
</script>
  
  <style lang="scss" scoped>
  ::v-deep .el-date-editor--daterange.el-input__inner{
    width: 100%;
  }
  ::v-deep .el-select--small{
    width: 100%;
  }
</style>
  